Remove INVALID_HANDLE pattern and add comprehensive exception handling documentation#304
Remove INVALID_HANDLE pattern and add comprehensive exception handling documentation#304
Conversation
Co-authored-by: Ulrond <131959864+Ulrond@users.noreply.github.com>
Co-authored-by: Ulrond <131959864+Ulrond@users.noreply.github.com>
|
@copilot |
I want to make sure I understand your request correctly. Are you asking to:
Currently, I've added Could you clarify the scope? Should this be:
|
@copilot Success: The method returns |
Co-authored-by: hari22yuva <56021398+hari22yuva@users.noreply.github.com>
... Added general exception handling documentation to all 36 AIDL interface files and updated function-level notes in IAVBuffer to reference the general documentation. Changes in commit 66eb630:
The documentation now follows the pattern you requested:
|
Hi @copilot |
Co-authored-by: hari22yuva <56021398+hari22yuva@users.noreply.github.com>
Co-authored-by: hari22yuva <56021398+hari22yuva@users.noreply.github.com>
... Added function-level exception handling notes to all functions that return values across all interfaces. Changes in commit 57a0b1c:
Example from IBoot: /**
* Gets the capabilities of the boot service.
*
* @returns Capabilities parcelable.
*
* @note On exception, output parameters/return values are undefined and must not be used. (See {{@link IBoot}} for exception handling behavior).
*/
Capabilities getCapabilities();All interfaces now have both interface-level general documentation and function-level notes that reference it. |
Handle allocation functions previously documented returning sentinel values (e.g.,
INVALID_HANDLE = -1) on success with a status code requiring dual validation. This created an edge case where transactions succeeded without error but returned invalid handles.Changes
AIDL Interface Constants
INVALID_HANDLEandINVALID_POOLconstants fromIAVBuffer.aidlandPool.aidlError Handling Contract
createVideoPool(),createAudioPool(),alloc(): Success returns valid handle; exception means handle is untrusted@notedirectives documenting exception state: "On exception, the returned handle is an unknown value and must not be used"EX_ILLEGAL_ARGUMENT if videoDecoderIndex is invalid)Exception Handling Documentation
binder::Status::Exception::EX_NONEwith valid output parameters/return valuesEX_SERVICE_SPECIFIC,EX_ILLEGAL_ARGUMENT) with undefined (garbage) output parameters that must not be used@notetags to every function that returns a value across all 36 interfaces, referencing the interface-level exception handling documentation using{@link}referencesDecoder Documentation
-1inframeBufferHandlecallbacks indicates tunnelled mode (vendor layer consumption), not error stateBefore/After
Files Modified
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.